<template>
  <view class="order-detail">
    <!-- 订单状态卡片 -->
    <view class="status-card">
      <view class="status-content">
        <up-icon
          name="checkmark-circle-fill"
          color="#19be6b"
          size="48"
        ></up-icon>
        <view class="status-text">
          <text class="title">订单已完成</text>
          <text class="desc">感谢您的信任，期待再次为您服务</text>
        </view>
      </view>
    </view>

    <!-- 收货信息 -->
    <view class="info-card">
      <view class="card-header">
        <up-icon name="map-pin" size="24" color="#2979ff"></up-icon>
        <text class="title">收货信息</text>
      </view>
      <view class="address-info">
        <text class="name-phone">张三 138****8888</text>
        <text class="address">北京市朝阳区建国路88号</text>
      </view>
    </view>

    <!-- 商品信息 -->
    <view class="info-card">
      <view class="card-header">
        <up-icon name="shopping-cart" size="24" color="#2979ff"></up-icon>
        <text class="title">商品信息</text>
      </view>
      <view class="goods-item">
        <image class="goods-img" src="/static/goods/1.jpg"></image>
        <view class="goods-info">
          <text class="goods-title">美国旅游签证(B1/B2)</text>
          <text class="goods-spec">标准套餐</text>
          <view class="price-line">
            <text class="price">¥1288</text>
            <text class="quantity">x1</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 订单信息 -->
    <view class="info-card">
      <view class="card-header">
        <up-icon name="list" size="24" color="#2979ff"></up-icon>
        <text class="title">订单信息</text>
      </view>
      <view class="order-info">
        <view class="info-item">
          <text class="label">订单编号：</text>
          <text class="value">V20240515001</text>
        </view>
        <view class="info-item">
          <text class="label">下单时间：</text>
          <text class="value">2024-05-15 14:30:22</text>
        </view>
        <view class="info-item">
          <text class="label">支付方式：</text>
          <text class="value">微信支付</text>
        </view>
        <view class="info-item">
          <text class="label">订单金额：</text>
          <text class="value price">¥1288</text>
        </view>
      </view>
    </view>

    <!-- 底部操作按钮 -->
    <view class="footer">
      <up-button plain custom-style="margin-right: 20rpx">再次申请</up-button>
      <up-button type="primary">联系客服</up-button>
    </view>
  </view>
</template>

<script lang="ts" setup>
function goBack() {
  uni.navigateBack();
}
</script>

<style lang="scss" scoped>
@mixin text-ellipsis($lines: 1) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: -webkit-box;
  -webkit-line-clamp: $lines;
  -webkit-box-orient: vertical;
}
.order-detail {
  background-color: #f5f5f5;
  min-height: 100vh;
  padding-bottom: 120rpx;

  .status-card {
    background: linear-gradient(135deg, #2979ff, #4dabff);
    color: #fff;
    padding: 30rpx;
    margin-bottom: 20rpx;

    .status-content {
      display: flex;
      align-items: center;

      .status-text {
        margin-left: 20rpx;

        .title {
          font-size: 32rpx;
          font-weight: bold;
          display: block;
          margin-bottom: 8rpx;
        }

        .desc {
          font-size: 24rpx;
          opacity: 0.9;
        }
      }
    }
  }

  .info-card {
    background-color: #fff;
    border-radius: 12rpx;
    padding: 24rpx;
    margin: 0 20rpx 20rpx;

    .card-header {
      display: flex;
      align-items: center;
      padding-bottom: 20rpx;
      border-bottom: 1rpx solid #f5f5f5;
      margin-bottom: 20rpx;

      .title {
        font-size: 28rpx;
        font-weight: bold;
        margin-left: 12rpx;
      }
    }

    .address-info {
      .name-phone {
        font-size: 28rpx;
        font-weight: bold;
        display: block;
        margin-bottom: 12rpx;
      }

      .address {
        font-size: 26rpx;
        color: #666;
        line-height: 1.6;
      }
    }

    .goods-item {
      display: flex;
      padding: 20rpx 0;

      .goods-img {
        width: 160rpx;
        height: 120rpx;
        border-radius: 8rpx;
        flex-shrink: 0;
      }

      .goods-info {
        flex: 1;
        padding-left: 20rpx;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .goods-title {
          font-size: 28rpx;
          font-weight: bold;
          @include text-ellipsis(2);
        }

        .goods-spec {
          font-size: 24rpx;
          color: #999;
        }

        .price-line {
          display: flex;
          justify-content: space-between;
          align-items: center;

          .price {
            font-size: 28rpx;
            color: #f44;
            font-weight: bold;
          }

          .quantity {
            font-size: 24rpx;
            color: #999;
          }
        }
      }
    }

    .order-info {
      .info-item {
        display: flex;
        justify-content: space-between;
        padding: 16rpx 0;
        font-size: 26rpx;

        .label {
          color: #999;
        }

        .value {
          color: #333;

          &.price {
            color: #f44;
            font-weight: bold;
          }
        }
      }
    }
  }

  .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    padding: 20rpx;
    display: flex;
    justify-content: flex-end;
    box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  }
}
</style>
